for kk in /boot/vmlinu*-*64; do
if [ "$kk" != "/boot/vmlinu*-*64" ]; then
    have64="true"
    if cpuid -l; then
        have_kernel="true"
    else
        have_kernel="false"
    fi
fi
done
for kk in /boot/vmlinu*-*86; do
if [ "$kk" != "/boot/vmlinu*-*86" ]; then
    have32="true"
    have_kernel="true"
fi
done
if [ "${have_kernel}" != "true" ]; then
    menuentry --class=find.none "NO SUITABLE KERNELS AVAILABLE" {echo $@  echo "There are no kernels suitable for this machine available."
        echo ""
        if ! cpuid -l; then
            echo "This machine is NOT 64bit capable."
            echo ""
        fi
        echo "There are no suitable kernels available"
        if [ "${have64}" == "true" ]; then
            echo ""
            echo "It appears you are trying to boot a 64bit release on a 32bit machine"
            echo "This cannot work!"
        fi
        echo ""
        echo "Press Escape to return to the main menu"
        sleep --interruptible 9999
        menu_reload
    }
else
    title=""
    for kopt in x86_64 $kopts  misobasedir=manjaro misolabel=MANJARO_XFCE_2021 quiet systemd.show_status=1 'apparmor=1' 'security=apparmor'; do
        if [ -n "$title" ] ; then
            title="$title $kopt";
        else
            title="$kopt";
        fi;
    done
    menuentry "Boot with open source drivers" --class=Manjaro.x86_64 "$title" {# set arguments above with the editor
        linux /boot/vmlinuz-$2 driver=free nouveau.modeset=1 i915.modeset=1 radeon.modeset=1
        initrd /boot/amd_ucode.img /boot/intel_ucode.img /boot/initramfs-x86_64.img
    }
    menuentry "Boot with proprietary drivers" --class=Manjaro.x86_64 "$title" {# set arguments above with the editor
        linux /boot/vmlinuz-$2 driver=nonfree nouveau.modeset=0 i915.modeset=1 radeon.modeset=1
        initrd /boot/amd_ucode.img /boot/intel_ucode.img /boot/initramfs-x86_64.img
    }
fi
